function BannerController(banner, time) {
  const path = "../img/banner-pics/";
  const pics = new Array("pic1.jpg", "pic2.jpg", "pic3.jpg")
  const changeImage = (img) => {
    let i = 0;
    return () => {
      i %= pics.length;
      img.setAttribute("src", path + pics[i]);
      i++;
    }
  }
  setInterval(changeImage(banner.getElementsByTagName("img")[0]), time);
}

export default BannerController;